package Tem;

import java.util.Scanner;

public class Tem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in = scanner.nextLine();
        String[] sp = in.split(" ");

        in = sp[0];
        int k = Integer.valueOf(sp[1]);

        StringBuilder chars = new StringBuilder(in);

        for (int i = 0; i < k; i++) {

        }


        int flag = 0;
        int one = 0;
        for (int i = 0; i < chars.length(); i++) {
            if (chars.charAt(i) == '1') {
                one++;
            } else {//=='0'
                if (one < flag) one = 0;
                else flag = one;
            }
        }
    }
}